/*
 * @lc app=leetcode.cn id=537 lang=cpp
 *
 * [537] 复数乘法
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <complex>

using namespace std;
// @lc code=start
class Solution {
public:
    string complexNumberMultiply(string num1, string num2) {
        auto get = [](string& s){
            complex<int> x;
            stringstream ss(s);
            int i, r; char c;
            ss >> r >> c >> i;
            return complex<int>(r, i);
        };
        auto a = get(num1) * get(num2);
        return to_string(a.real()) + '+' + to_string(a.imag()) + 'i';
    }
};
// @lc code=end

